﻿using System;

namespace PropertyExpression.ControllableQuery.Demo
{
    public interface IPost
    {
        int Id { get; }
        DateTime? CreationDate { get; }
    }

    class SomeClass1
    {
        void Method1(DateTime? date)
        {
            var posts = Query<IPost>.New(new {date}, @"
SELECT  Id, CreationDate
FROM    Post
WHERE   1 = 1
@if (date.HasValue) {
        @:AND CreationDate >= @date
}").List();
        }
    }
}
